home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
tex
/
macros
/
distribs
/
ftnright
/
ftnright.doc
(
.txt
)
< prev
next >
Wrap
LaTeX Document
|
1993-05-17
|
36KB
|
813 lines
% \iffalse meta-comment
% Copyright (C) 1989-1992 by Frank Mittelbach. All rights reserved.
% IMPORTANT NOTICE:
% You are not allowed to change this file. You may however copy this
% file to a file with a different name and then change the copy.
% You are NOT ALLOWED to distribute this file alone. You are NOT
% ALLOWED to take money for the distribution or use of this file (or a
% changed version) except for a nominal charge for copying etc.
% You are allowed to distribute this file under the condition that it is
% distributed together with all files mentioned in readme.mz6.
% If you receive only some of these files from someone, complain!
% However, if these files are distributed by established suppliers as
% part of a complete TeX distribution, and the structure of the
% distribution would make it difficult to distribute the whole set of
% files, *those parties* are allowed to distribute only some of the
% files provided that it is made clear that the user will get a complete
% distribution-set upon request to that supplier (not me). Notice that
% this permission is not granted to the end user.
% For error reports in case of UNCHANGED versions see readme files.
% \fi
\def\filename{ftnright}
\def\fileversion{v1.0d}
\def\filedate{92/06/19}
\def\docdate {92/06/19}
%% \CheckSum{303}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
% \MakeShortVerb{\|}
% \DoNotIndex{\;}
%^^A \DoNotIndex{\@cclv}
%^^A \DoNotIndex{\@colht}
%^^A \DoNotIndex{\@colroom}
% \DoNotIndex{\@combinedblfloats}
% \DoNotIndex{\@combinefloats}
% \DoNotIndex{\@dblfloatplacement}
% \DoNotIndex{\@deferlist}
% \DoNotIndex{\@empty}
%^^A \DoNotIndex{\@fcolmadefalse}
%^^A \DoNotIndex{\@firstcolumnfalse}
%^^A \DoNotIndex{\@firstcolumntrue}
% \DoNotIndex{\@freelist}
% \DoNotIndex{\@ixpt}
%^^A \DoNotIndex{\@leftcolumn}
%^^A \DoNotIndex{\@m}
%^^A \DoNotIndex{\@makecol}
%^^A \DoNotIndex{\@makefntext}
%^^A \DoNotIndex{\@maxdepth}
% \DoNotIndex{\@midlist}
%^^A \DoNotIndex{\@outputbox}
%^^A \DoNotIndex{\@outputdblcol}
%^^A \DoNotIndex{\@outputpage}
% \DoNotIndex{\@ptsize}
%^^A \DoNotIndex{\@setsize}
% \DoNotIndex{\@spaces}
%^^A \DoNotIndex{\@startcolumn}
%^^A \DoNotIndex{\@startdblcolumn}
% \DoNotIndex{\@tempdima}
% \DoNotIndex{\@textbottom}
% \DoNotIndex{\@texttop}
%^^A \DoNotIndex{\@thefnmark}
% \DoNotIndex{\@viiipt}
% \DoNotIndex{\@whilesw}
% \DoNotIndex{\@width}
%^^A \DoNotIndex{\@xstartcol}
% \DoNotIndex{\@xpt}
% \DoNotIndex{\advance}
% \DoNotIndex{\begingroup}
% \DoNotIndex{\box}
%^^A \DoNotIndex{\boxmaxdepth}
%^^A \DoNotIndex{\columnseprule}
%^^A \DoNotIndex{\columnwidth}
% \DoNotIndex{\count}
% \DoNotIndex{\def}
% \DoNotIndex{\dimen}
% \DoNotIndex{\docdate}
% \DoNotIndex{\dp}
% \DoNotIndex{\else}
% \DoNotIndex{\endgroup}
% \DoNotIndex{\fi}
% \DoNotIndex{\filedate}
% \DoNotIndex{\filename}
% \DoNotIndex{\fileversion}
%^^A \DoNotIndex{\footins}
%^^A \DoNotIndex{\footnoterule}
%^^A \DoNotIndex{\footnotesep}
%^^A \DoNotIndex{\footnotesize}
%^^A \DoNotIndex{\ftn@amount}
% \DoNotIndex{\gdef}
% \DoNotIndex{\global}
% \DoNotIndex{\hbox}
% \DoNotIndex{\hfil}
% \DoNotIndex{\hss}
% \DoNotIndex{\ht}
%^^A \DoNotIndex{\if@fcolmade}
%^^A \DoNotIndex{\if@firstcolumn}
% \DoNotIndex{\ifcase}
%^^A \DoNotIndex{\ifvoid}
% \DoNotIndex{\ifx}
%^^A \DoNotIndex{\insert}
% \DoNotIndex{\ixpt}
% \DoNotIndex{\let}
% \DoNotIndex{\llap}
% \DoNotIndex{\long}
%^^A \DoNotIndex{\maxdepth}
%^^A \DoNotIndex{\newdimen}
%^^A \DoNotIndex{\newskip}
% \DoNotIndex{\noindent}
% \DoNotIndex{\normalsize}
% \DoNotIndex{\or}
%^^A \DoNotIndex{\parindent}
%^^A \DoNotIndex{\preparefootins}
%^^A \DoNotIndex{\rcol@footinsskip}
%^^A \DoNotIndex{\saved@footinsskip}
% \DoNotIndex{\setbox}
% \DoNotIndex{\skip}
% \DoNotIndex{\space}
%^^A \DoNotIndex{\strutbox}
%^^A \DoNotIndex{\textheight}
%^^A \DoNotIndex{\textwidth}
% \DoNotIndex{\unvbox}
% \DoNotIndex{\vbox}
% \DoNotIndex{\viiipt}
% \DoNotIndex{\vrule}
% \DoNotIndex{\vskip}
%^^A \DoNotIndex{\wlog}
% \DoNotIndex{\xdef}
% \DoNotIndex{\xpt}
% \DoNotIndex{\z@}
% \renewcommand{\.}{\penalty500} %^^A for certain breaks
% \title{Footnotes in a multi-column layout\thanks
% {The \LaTeX{} style option {\tt \filename} which is described
% in this article has the version number \fileversion{} dated
% \filedate. The documentation was last revised on \docdate.}}
% \author{Frank Mittelbach\\
% Electronic Data Systems (Deutschland) GmbH\\
% Eisenstra\ss e 56 N15\\
% D-6090 R\"usselsheim}
% \maketitle
% \pageshrink 1pt %^^A compensate for the \thanks marker
% \section{Introduction}
% The placement of footnotes in a multi-column layout always bothered
% me. The approach taken by \LaTeX{} (i.e., placing the footnotes
% separately under each column) might be all right if nearly no
% footnotes are present. But it looks clumsy when both columns contain
% footnotes, especially when they occupy different amounts of space.
% In the multi-column style option~\cite{art:FMi89b}, I used page-wide
% footnotes at the bottom of the page, but again the result doesn't
% look very pleasant since short footnotes produce undesired gaps of
% white space. Of course, the main goal of this style option was a
% balancing algorithm for columns which would allow switching between
% different numbers of columns on the same page. With this feature,
% the natural place for footnotes seems to be the bottom of the
% page\footnote{You can not use column footnotes at the bottom, since
% the number of columns can differ on one page.} but looking at some
% of the results it seems best to avoid footnotes in such a layout
% entirely.
% Another possibility is to turn footnotes into endnotes, i.e.,
% printing them at the end of every chapter or the end of the entire
% document. But I assume everyone who has ever read a book using such
% a layout will agree with me, that it is a pain to search back and
% forth, so that the reader is tempted to ignore the endnotes
% entirely.
% When I wrote the article about ``Future extensions of
% \TeX{}''~\cite{inproc:FMi90} I was again dissatisfied with the
% outcome of the footnotes, and since this article should show certain
% aspects of high quality typesetting, I decided to give the footnote
% problem a try and modified the \LaTeX{} output routine for this
% purpose. The layout I used was inspired by the yearbook of the
% Gutenberg Gesellschaft Mainz \cite{book:GG}. Later on, I found that
% it is also recommended by Jan White \cite{book:JWh88}. On the layout
% of footnotes I also consulted books by Jan Tschichold
% \cite{book:JTs87} and Manfred Simoneit \cite{book:MSi89}, books, I
% would recommend to everyone being able to read German texts.
% \subsection{Description of the new layout}
% The result of this effort is presented in this paper and the reader
% can judge for himself whether it was successful or
% not.\footnote{Please note, that this option only changed the
% placement of footnotes. Since this article also makes use of the
% {\tt doc} option \cite{art:fmi89a}, that assigns tiny numbers to
% code lines sprincled throughout the text, the resulting design is
% not perfect.} The main idea for this layout is to assemble the
% footnotes of all columns on a page and place them all together at
% the bottom of the right column. Allowing for enough space between
% footnotes and text, and in addition, setting the footnotes in
% smaller type\footnote{The standard layout in \TUB{} uses the same
% size for footnotes and text, giving the footnotes, in my opinion,
% much too much prominence.} I decided that one could omit the
% footnote separator rule which is used in most publications prepared
% with \TeX{}.\footnote{People who prefer the rule can add it by
% redefining the command {\tt\bslash footnoterule}
% \cite[p.~156]{book:LLa86}. Please, note, that this command should
% occupy no space, so that a negative space should be used to
% compensate for the width of the rule used.} Furthermore, I decided
% to place the footnote markers\footnote{\label{thisftn} The tiny
% numbers or symbols, e.g., the `\ref{thisftn}' in front of this
% footnote.} at the baseline instead of raising them as
% superscripts.\footnote{Of course, this is only done for the mark
% preceeding the footnote text and not the one used within the main
% text where a raised number or symbol set in smaller type will help
% to keep the flow of thoughts, uninterrupted.}
% All in all, I think this generates a neat layout, and surprisingly
% enough, the necessary changes to the \LaTeX{} output routine are
% nevertheless astonishingly simple.
% \subsection{The use of the style option}
% This style option might be used together with any other style option
% for \LaTeX{} which does not change the three internals changed by
% {\tt \filename.sty}.\footnote{These are the macros {\tt\bslash
% @startcolumn}, {\tt\bslash @makecol} and {\tt\bslash @outputdblcol}
% as we will see below. Of course, the option will take only effect
% with a document style using a twocolumn layout (like {\tt ltugboat})
% or when the user additionally specifies {\tt twocolumn} as a
% document style option in the {\tt\bslash documentstyle} command.} In
% most cases, it is best to use this style option as the very last
% option in the |\documentstyle| command to make sure that its
% settings are not overwritten by other options.\footnote{The {\tt
% ltugboat} option (which is currently set up as a style option
% instead of a document style option which it actually is) will
% overwrite the size used in footnotes if it follows the {\tt
% \filename} option.}
% It is unfortunate that the current \LaTeX{} has no provisions to make
% such changes without overwriting the internal routines. In the new
% \LaTeX{} implementation, we will certainly add some hooks that will
% make such changes more easy.
% The {\tt\filename} option makes use of the values of |\textheight|
% and|\skip|\.|\footins| (the space between text and footnotes). The
% values used are the ones current when {\tt \filename.sty} is read
% in. If the user wants to change either of them in the preamble of
% his document he should call the macro |\preparefootins| afterwards
% to reinitialize the footnote algorithm, e.g.,
% \begin{verbatim}
% \setlength{\skip\footins}{8pt plus 3pt}
% \addtolength{\textheight}{1in}
% \preparefootins
%\end{verbatim}
% This is necessary because the current \LaTeX{} version contains no
% hook at the |\begin{document}| command where we could force an
% execution of |\preparefootins| internally.
% \StopEventually{
% \begin{thebibliography}{1}
% \bibitem{book:GG}
% Hans-Joachim Koppitz, editor.
% \newblock {\em {Gutenberg Jahrbuch}}.
% \newblock Gutenberg-Gesellschaft, Mainz.
% \bibitem{book:LLa86}
% Leslie Lamport.
% \newblock {\em {\LaTeX:} A Document Preparation System}.
% \newblock Addison-Wesley, Reading, Massachusetts, 1986.
% \bibitem{man:LLa90}
% Leslie Lamport.
% \newblock {\em {\tt latex.tex}}, February 1990.
% \newblock {\LaTeX} source version 2.09.
% \bibitem{art:fmi89a}
% Frank Mittelbach
% \newblock The {\tt doc}-option.
% \newblock {\em TUGboat}, 10(2):245--273, July 1989.
% \bibitem{art:FMi89b}
% Frank Mittelbach
% \newblock An environment for multi-column output.
% \newblock {\em TUGboat}, 10(3):407--415, November 1989.
% \bibitem{inproc:FMi90}
% Frank Mittelbach
% \newblock E-{\TeX}: Guidelines to future {\TeX} extensions.
% \newblock In LincolnK. Durst, editor, {\em \TUB}, 11(3):
% {\em 1990 TUG Annual Meeting Proceedings}, pages
% 337--345, September 1990.
% \bibitem{book:MSi89}
% Manfred Siemoneit.
% \newblock {\em Typographisches {G}estalten}.
% \newblock Polygraph Verlag, Frankfurt am Main, second edition, 1989.
% \bibitem{book:JTs87}
% Jan Tschichold.
% \newblock {\em {Ausgew\"ahlte Aufs\"atze \"uber Fragen der Gestalt des
% Buches}}.
% \newblock Birkh\"auser Verlag, Basel, 1987.
% \newblock Second printing.
% \bibitem{book:JWh88}
% Jan White.
% \newblock {\em Graphic Design for the Electronic Age}.
% \newblock Watson Guptill, Xerox Press, New York, 1988.
% \end{thebibliography}
% \PrintIndex
% }
% \section{The Implementation}
% As usual, we start by identifying the current version of this style
% file in the transcript file.\footnote{Nico Poppelier suggested
% omitting the {\tt\bslash typeout} statements in the production
% version of the files to avoid showing all that unnecessary
% information to the user. While I accept his criticism as valid, I
% decided that this information should at least be placed into the
% transcript file to make it easier to detect problems arising from
% the use of older versions. The command {\tt\bslash wlog} is a
% \PlainTeX{} command that will write its argument to the transcript
% file.}
% \begin{macrocode}
%<*style>
\wlog{Style Option: `\filename'
\fileversion\space <\filedate> (FMi)}
\wlog{English Documentation
\@spaces\@spaces\space <\docdate> (FMi)}
% \end{macrocode}
% To implement the layout described, above we have to distinguish
% between the left and the right column on a page. For this purpose
% \LaTeX{} maintains the switch |\if@firstcolumn|. When assembling
% material for the left (i.e., the first) column, footnotes should
% take up no space, since they are held over for the second column. In
% the second column these footnotes are combined with the ones found
% there and placed a suitable distance from the main text at the
% bottom of this column.
% This means that we have to change certain parameters for the
% insertion |\footins| when we construct the second column. The right
% place to do this is in the \LaTeX{} macro |\@outputdblcol| which we
% are going to change later on. What settings for the insertion
% parameters are appropriate? For setting the first column
% |\count|\.|\footins| and |\skip|\.|\footins| should both be zero
% since footnotes are held over while for the second column
% |\count|\.|\footins| should be $1000$ and the |\skip|\.|\footins|
% has to be set to the desired separation between main text and
% footnotes.\footnote{A value of $1000$ means that there is a
% one-to-one relationship between the real size of the footnote and
% the size finally occupied by the footnote on the current page.}
% We will allow one column of footnotes (i.e., the right column) at
% most, so that |\dimen|\.|\footins| has to equal |\textheight|. In
% principle, it would be possible to allow for even more footnotes,
% but this would complicate matters enormously.\footnote{It is not
% possible to make {\tt\bslash dimen\bslash footins} larger than
% {\tt\bslash textheight} directly, because this would result in a
% full left column (with text) and more than one column of footnotes.
% Instead, one has to make footnotes visible to the page generation
% algorithm again at the moment when a full column of footnotes is
% assembled, but we still have some space left in the first column. It
% is a nice enhancement, and, I suppose, it is of some value for
% preparing publications in certain disciplines, so here is the
% challenge~\ldots}
% \begin{macro}{\preparefootins}
% \begin{macro}{\saved@footinsskip}
% Since a document usually starts with a left column, we have to
% set |\count| and |\skip|\.|\footins| on top-level to zero. For
% this purpose, we define a macro |\preparefootins| which will
% first save the current value of |\skip|\.|\footins| in a safe
% place. This saved value will be used later for the second column.
% In this way, it is possible for the user or a designer of a
% document style to adjust this parameter without fiddling with the
% code of this style file.
% \begin{macrocode}
\def\preparefootins{%
\global\rcol@footinsskip\skip\footins
\global\skip\footins\z@
\global\count\footins\z@
% \end{macrocode}
% We will also assign |\textheight| to |\dimen|\.|\footins| to
% allow the user to change this parameter in the preamble.
% \begin{macrocode}
\global\dimen\footins\textheight}
% \end{macrocode}
% It is necessary to make the assignments above |\global| because
% we are going to use this macro in the output routine which has an
% implicit grouping level to keep the changes made by it local.
% \end{macro}
% Of course, we have to allocate the {\sf skip} register that we
% used above:
% \begin{macrocode}
\newskip\rcol@footinsskip
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@outputdblcol}
% Now we have all the necessary tools available to tackle
% |\@outputdblcol|. We have to remember that when
% |\if@firstcolumn| equals |\iftrue|, we are currently starting to
% build the second column, i.e., that the first column is already
% assembled. Therefore, the macro will start with the following
% code:
% \begin{macrocode}
\def\@outputdblcol{\if@firstcolumn
\global\@firstcolumnfalse
% \end{macrocode}
% After changing the switch, we save the first column (which was
% placed by preceeding macros in |\@outputbox|) in the box register
% |\@leftcolumn|. Since we are inside the output routine, all those
% assignments have to be |\global| to take any effect.
% \begin{macrocode}
\global\setbox\@leftcolumn\box\@outputbox
% \end{macrocode}
% Then, we make the footnotes visible to the page generation
% algorithm by setting |\count\footins| to $1000$ (|\@m| is an
% abbreviation for this number) and |\skip\footins| to its saved
% value (i.e., |\rcol@footinsskip|).
% \begin{macrocode}
\global\count\footins\@m
\global\skip\footins\rcol@footinsskip
% \end{macrocode}
% We also have to reinsert all footnotes left over from the first
% column to make sure that they are reconsidered by the page
% generation algorithm of \TeX{} using the new values for |\count|
% and |\skip|\.|\footins|. But this will be done later in the
% macro |\@startcolumn|.
% If we have just finished the right column, i.e., when
% |\if@firstcolumn| equals |\iffalse|, we will reset the |\footins|
% parameters as explained above using the utitlity macro
% |\preparefootins|.
% \begin{macrocode}
\else \preparefootins
% \end{macrocode}
% Then, we compose both columns in |\@outputbox|, combine them with
% all page-wide floats for this page (|\@combinedblfloats|), attach
% header and footer, and ship out the result (|\@outputpage|).
% Finally we look to see whether it is possible to generate
% following pages consisting only of page-wide
% floats.\footnote{This part is copied directly from the original
% \LaTeX{} macro. Details about the used macros, their interfaces
% and meanings can be found in the \LaTeX{} source
% code~\cite{man:LLa90}.}
% \begin{macrocode}
\global\@firstcolumntrue
\setbox\@outputbox\vbox{\hbox to\textwidth
{\hbox to\columnwidth
{\box\@leftcolumn\hss}%
\hfil\vrule\@width\columnseprule\hfil
\hbox to\columnwidth
{\box\@outputbox\hss}}}%
\@combinedblfloats\@outputpage
\begingroup
\@dblfloatplacement\@startdblcolumn
\@whilesw\if@fcolmade\fi
{\@outputpage\@startdblcolumn}%
\endgroup
\fi}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@startcolumn}
% \changes{v1.0b}{90/08/11}{Macro added to correct float problems}
% There is a fundamental flaw in \LaTeX's output routine for float
% columns and float pages: split footnotes, i.e., footnotes which
% are only partly typeset on the preceding page are not resolved.
% They are held over until \LaTeX{} starts a page (or column)
% containing text besides floats again. For our current layout,
% this would mean, that if \LaTeX{} decided to make the right
% column of a page a float column, footnotes from the left column
% would appear on a later page. A real cure for this problem would
% be to rewrite two-thirds of \LaTeX{}'s output routine, so I am
% leaving this open for the interested reader.
% \begin{figure}[b]
% \fbox{%^^A
% \newlength{\puzzlewd}%^^A
% \setlength{\puzzlewd}{\columnwidth}%^^A
% \addtolength{\puzzlewd}{-2.1\fboxsep}%^^A
% \begin{minipage}{\puzzlewd}
% \vspace{17pt}
% \begin{center}
% \bf Puzzle:
% \end{center}
% \vspace{-3pt}
% \small
% \begin{quote}
% \rightskip \leftmargini plus 2.5em
% Given a simple \TeX{} document containing only straight text, is
% it possible for the editor, after
% deleting one sentence, to end up with a document
% producing an extra page?
% We assume that the deleted text contains no \TeX{} macros and
% that the document was prepared
% with a standard macro package like the one used for \TUB\/ production.
% \end{quote}
% \vspace{7pt}
% \begin{flushright}
% The answer will be given in the next issue.
% \end{flushright}
% \vspace{7pt}
% \end{minipage}}
% \end{figure}
% But the problem shows up even if only one float is contributed to
% the right column since \LaTeX{} assumes that the whole column is
% usable, whereas some of it might actually be already devoted to
% footnotes from the left column. So we have to change the output
% routine at least in the part that contributes floats to the next
% column. The macro involved is called |\@startcolumn|. The first
% thing we do is to check and see whether any deferred floats
% exists.
% \begin{macrocode}
\def\@startcolumn{%
\ifx\@deferlist\@empty
% \end{macrocode}
% If not, we set the switch |\if@fcolmade| to {\tt false} which
% says that we did not succeed in making a float column. Then, we
% set |\@colroom| to |\@colht|. The register |\@colht| holds the
% amount of space that is available for floats, text, and footnotes
% in one column, i.e., it equals |\textheight| minus the space
% devoted to page-wide floats. |\@colroom| is a similar register
% which holds the value |\@colht| minus space for column floats
% that are already contributed to the current column. Of course,
% both values should be equal when we start a new column.
% \begin{macrocode}
\global\@fcolmadefalse
\global\@colroom\@colht
\else
% \end{macrocode}
% If there are floats waiting for a change to be processed, the
% situation is more difficult. In this case, we have to reduce both
% |\@colht| and |\@colroom| by the amount of space that will be
% needed for the footnotes from the left column. So we must check
% whether such footnotes are present. As we have not reinserted
% them in |\@outputdblcol|, we can check the |\footins| box.
% \begin{macrocode}
\ifvoid\footins\else
% \end{macrocode}
% If there are some, we measure the space that will be occupied by
% them. This measurement is not really exact. If we have a full
% column of footnotes, it will be too high, but this does matter
% since we need it only for an upper bound on the free space
% available for floats.
% \begin{macrocode}
\ftn@amount\ht\footins
\advance\ftn@amount\dp\footins
\advance\ftn@amount\skip\footins
\fi
% \end{macrocode}
% We then reduce the |\@colht| by this amount and again assign
% |\@colroom| the value of |\@colht|. If no footnotes are present,
% we substract zero, so there is no harm in doing this operation
% all the time.
% \begin{macrocode}
\global\advance\@colht-\ftn@amount
\global\@colroom\@colht
% \end{macrocode}
% Now, we call another internal \LaTeX{} macro that will try to
% contribute floats to the next column. It will use the register
% |\@colht| when trying to build up a float column, which is the
% reason for reducing this register. If it succeeds, it will set the
% switch |\if@fcolmade| to {\tt true}, otherwise, to {\tt false}. If
% no float column is possible, it will try to place some or all of
% the deferred floats to the top or the bottom of the next column,
% thereby, using and reducing the value of the register |\@colroom|.
% \begin{macrocode}
\@xstartcol
% \end{macrocode}
% Afterwards, we have to restore the correct values for |\@colht|
% and |\@colroom| again, but this time, they may differ, so that we
% have to |\advance| both registers separately by |\ftn@amount|.
% \begin{macrocode}
\global\advance\@colht\ftn@amount
\global\advance\@colroom\ftn@amount
% \end{macrocode}
% Now, after doing the things depending on the status of the
% |\@deferlist|, we have to incorporate the left over footnotes in
% the new column. First we check whether a float column was
% produced by |\@xstartcol| or not.
% \begin{macrocode}
\if@fcolmade
% \end{macrocode}
% If so, we do something awful. To make use of the |\@makecol|
% macro, which attaches footnotes to |\box| $255$ and places the
% result in the box register |\@outputbox|, we have to assign
% |\@outputbox| (i.e., the result of |\@xstartcol|) to |\box|
% $255$.\footnote{In German, we call this ``from the back through
% the chest into the eyes''.}
% \begin{macrocode}
\setbox\@cclv\box\@outputbox
\@makecol
\else
% \end{macrocode}
% If no float column was produced, we reinsert the held over
% footnotes so that they can be reconsidered by the page generation
% algorithm of \TeX. But it is necessary to ensure that this
% operation is done only when footnotes are actually
% present.\footnote{Otherwise, we might get an undesired extra
% vertical space coming from {\tt\bslash skip\bslash footins}, even
% if there are no footnotes on the page.}
% \begin{macrocode}
\ifvoid\footins\else
\insert\footins{\unvbox\footins}\fi
\fi}
% \end{macrocode}
% \begin{macro}{\ftn@amount}
% Of course, we also have to allocate the {\sf dimen} register. It
% will be automatically initialized to zero.
% \begin{macrocode}
\newdimen\ftn@amount
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\@makecol}
% The other internal macro that we have to change is |\@makecol|, a
% macro that is called whenever one column of material is assembled
% and column floats and footnotes have to be added. Again, we have
% to distinguish between actions for the first and the second
% column.
% \begin{macrocode}
\def\@makecol{\if@firstcolumn
% \end{macrocode}
% For the first column, we leave the footnotes in their box and
% simply save the contents of box $255$ in the |\box| register
% |\@outputbox|.
% \begin{macrocode}
\setbox\@outputbox\box\@cclv
% \end{macrocode}
% But if the user errously forgot to specify a twocolumn layout, we
% will always typeset the first column, so that the footnotes are
% never printed. Therefore we better check for this special case
% and output the footnotes on a separate page in an
% emergency.\footnote{Otherwise, the footnotes are held over for
% ever, preventing \TeX{} from finishing the document successfully.
% Instead, \TeX{} will produce infinity many empty pages at the end
% of the document, trying in vain to output the held over
% footnotes. This problem was found by Rainer Sch\"opf when we
% prepared the paper for the Cork conference.}
% \changes{v1.0c}{90/08/24}{Introduced crude recovery if
% twocolumn false.}
% \changes{v1.0d}{92/06/19}{Better help message}
% \begin{macrocode}
\if@twocolumn \else
\ifvoid\footins \else
\@latexerr
{ftnright option used in one-column mode}%
{The ftnright option was designed to
work with LaTeX's standard^^Jtwocolumn
option. It does *not* work with the
multicol option.^^JSo please specify
`twocolum' in the \noexpand\documentstyle
command.}%
\shipout\box\footins \fi\fi
\else
% \end{macrocode}
% When we construct the second column, we must first check whether
% footnotes are actually present. If not, we perform the same
% actions as before.
% \begin{macrocode}
\ifvoid\footins
\setbox\@outputbox\box\@cclv
\else
% \end{macrocode}
% But, if footnotes are present, it may be possible that the whole
% column consists of footnotes, i.e., |\box| $255$ is empty. In
% this case, there is no use in placing any glue (|\skip\footins|)
% in front,\footnote{In fact, it would be a mistake since this glue
% was not taken into account when the footnotes where assembled, so
% it would produce an overfull box.} so we have to check for this
% possibility.
% \begin{macrocode}
\setbox\@outputbox\vbox
{\ifvoid\@cclv \else
\unvbox\@cclv
\vskip\skip\footins\fi
% \end{macrocode}
% But in any case, we place the |\footnoterule| in front of the
% footnotes even if this macro is not used by this style
% option.\footnote{This decision if certainly open to criticism,
% since there is nothing to separate. On the other hand, a rule or
% some other ornament in front of the footnotes is part of the
% design which should be used concistently throughout a document.
% As a last argument in favor of the rule, consider the situation
% where \LaTeX{} decided to place only floats and footnotes into
% the right hand column. In this case a separator again seems
% adequate. In this situation one can even argue that it is
% necessary to put in the {\tt \bslash skip\.\bslash footins}.}
% This ends the if-statement testing whether footnotes are present
% or not. It also ends the code which differs depending on the
% column number.
% \begin{macrocode}
\footnoterule\unvbox\footins}\fi
\fi
% \end{macrocode}
% Now the column floats are added at the top and the bottom, and
% the |\@outputbox| is adjusted to the full column height so that
% the glue inside will stretch in certain situations.\footnote{It
% is an interesting question as to whether the current layout works
% well with bottom floats or not. Actually, I would prefer to place
% the footnotes below the bottom floats instead of above, as it is
% done here. At least when the floats are part of the document and
% not puzzles thrown in. But I was too lazy to implement it
% because I seldom use floats. If somebody implements this layout
% (some parts of this macro have to be changed) I would be
% interested in seeing the code and some sample results.} Again,
% this code is copied verbatim from the original source, so I won't
% dwell on details.\footnote{I only changed {\tt\bslash dimen128}
% into {\tt\bslash @tempdima} which is, besides being faster and
% shorter, only a cosmetic change. The use of this hardwired {\sf
% dimen} register seems to indicate that this part of \LaTeX{} was
% written very early and left unchanged since then: an interesting
% fact for software archeologists.}
% \begin{macrocode}
\xdef\@freelist{\@freelist\@midlist}%
\gdef\@midlist{}\@combinefloats
\setbox\@outputbox\vbox to\@colht
{\boxmaxdepth\maxdepth
\@texttop
\@tempdima\dp\@outputbox
\unvbox\@outputbox
\vskip-\@tempdima
\@textbottom}%
\global\maxdepth\@maxdepth}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\footnotesize}
% Now we can tackle the remaining small changes to the standard
% layout. I decided to use a smaller size for footnotes but with a
% slightly larger leading than usual. This means that we have to
% redefine the |\footnotesize| macro which depends on options like
% {\tt 11pt} etc. Fortunately, there is a simple way to find out
% the main size of the document: the macro |\@ptsize| contains $0$,
% $1$, or $2$ standing for $10$, $11$, or $12$ points document text
% size.
% \begin{macrocode}
\ifcase \@ptsize
\def\footnotesize{\@setsize\footnotesize
{9.9pt}\viiipt\@viiipt}
\def\footnotesize{\@setsize\footnotesize
{11.1pt}\ixpt\@vixpt}
\def\footnotesize{\@setsize\footnotesize
{12.3pt}\xpt\@xpt}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\footnoterule}
% Setting footnotes in smaller type and separating them with
% sufficiant space from the main text allow us to omit the
% |\footnoterule| normally used.
% \begin{macrocode}
\let\footnoterule\@empty
% \end{macrocode}
% \end{macro}
% \begin{macro}{\footnotesep}
% Individual footnotes are separated from each other by a more or
% less baseline skip of the text size. This can be specified with
% the following code:
% \begin{macrocode}
{\normalsize
\global\footnotesep\ht\strutbox}
% \end{macrocode}
% Braces and |\global| were used to keep the switch to
% |\normalsize| local, just in case some weird layout starts out
% with a different text size for some reason.
% \end{macro}
% \begin{macro}{\@makefntext}
% And finally, a small but nice change, to the mark at the
% beginning of the footnote text. We will place it at the baseline
% instead of raising it as a superscript. Additionally, it will get
% a dot as punctuation.
% \changes{v1.0c}{90/08/24}{Added dot as recommended by Tschichold.}
% \begin{macrocode}
\long\def\@makefntext#1{\parindent 1em
\noindent\hbox to 2em{}%
\llap{$\@thefnmark.\;\;$}#1}
% \end{macrocode}
% \end{macro}
% \section{Initialisation}
% We defined the macro |\preparefootins| above, but we also have to use
% it to prepare typesetting the first column. As a default for the
% separation of footnotes and text on the second column, we use the
% following:
% \begin{macrocode}
\skip\footins 10pt plus 5pt minus 3pt
\preparefootins
%</style>
% \end{macrocode}
% Of course, this value can be changed, on by the user as
% described in the introduction.
% \section{The documentation driver file}
% The final bit of code contains the documentation driver file for
% \TeX{}, i.e., the file that will produce the documentation you are
% currently reading. It will be extracted from this file by the {\tt
% docstrip} program.
% \changes{v1.0d}{92/04/19}{Added driver file to source}
% \begin{macrocode}
%<+drv>\documentstyle[doc,ftnright%
%<+drv> ,twocolum]{article}
%<+drv>
%<+drv>\newcommand{\TUB}{{\sl TUGboat\/}}
%<+drv>\renewcommand\DescribeMacro[1]{\fbox
%<+drv> {\PrintDescribeMacro{#1}}}
%<+drv>\renewcommand\DescribeEnv[1]{\fbox
%<+drv> {\PrintDescribeEnv{#1}}}
%<+drv>\renewcommand\PrintMacroName[1]{}
%<+drv>
%<+drv>\setlength{\textwidth}{39pc}
%<+drv>\setlength{\textheight}{54pc}
%<+drv>\setlength{\parindent}{1em}
%<+drv>\setlength{\parskip}{2pt plus1pt minus1pt}
%<+drv>\setlength{\oddsidemargin}{0pc}
%<+drv>\setlength{\marginparwidth}{0pc}
%<+drv>\setlength{\topmargin}{-2.5pc}
%<+drv>\setlength{\headsep}{20pt}
%<+drv>\setlength{\columnsep}{1.5pc}
%<+drv>\renewcommand{\bottomfraction}{.4}
%<+drv>
%<+drv>\flushbottom
%<+drv>\CodelineIndex
%<+drv>\EnableCrossrefs
%<+drv>
%<+drv>\setcounter{IndexColumns}{2}
%<+drv>\IndexPrologue{\section{Index}
%<+drv> All numbers denote code lines where
%<+drv> the corresponding entry is used,
%<+drv> underlined entries point to the
%<+drv> definition.}
%<+drv>
%<+drv>\begin{document}
%<+drv> \DocInput{ftnright.doc}
%<+drv>\end{document}
% \end{macrocode}
% \Finale
\endinput